<html>
<head><meta charset="utf-8"><title>Search PRs for a file · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html">Search PRs for a file</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="244819716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Denton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819716">(Jul 03 2021 at 19:06)</a>:</h4>
<p>Is it possible to search all open PRs to see if they change a particular file? I know this might be a weird thing to ask but there are a lot of open PRs on the main repository and I'd like a way to narrow it down to what interests me.</p>



<a name="244819730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819730">(Jul 03 2021 at 19:06)</a>:</h4>
<p><span class="user-mention" data-user-id="260325">@Chris Denton</span> I don't know if you can search, but you can set highfive to ping you on changes to that file</p>



<a name="244819736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819736">(Jul 03 2021 at 19:07)</a>:</h4>
<p>e.g. <a href="https://github.com/rust-lang/highfive/pull/275">https://github.com/rust-lang/highfive/pull/275</a></p>



<a name="244819754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819754">(Jul 03 2021 at 19:07)</a>:</h4>
<p>unfortunately it currently only works when the PR is first opened <a href="https://github.com/rust-lang/highfive/issues/223">https://github.com/rust-lang/highfive/issues/223</a></p>



<a name="244819820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Denton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819820">(Jul 03 2021 at 19:09)</a>:</h4>
<p>Ooh, that's interesting nonetheless!</p>



<a name="244819823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Yu [they/she] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819823">(Jul 03 2021 at 19:09)</a>:</h4>
<p>you could fetch the <code>/refs/pull</code> references from github and search them locally, but i don't know how to narrow that to only the PRs that are open</p>



<a name="244819886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819886">(Jul 03 2021 at 19:10)</a>:</h4>
<p>you could query the github API for open PRs maybe</p>



<a name="244819896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819896">(Jul 03 2021 at 19:10)</a>:</h4>
<p><a href="https://docs.github.com/en/rest/reference/pulls#list-pull-requests">https://docs.github.com/en/rest/reference/pulls#list-pull-requests</a></p>



<a name="244819921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Denton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819921">(Jul 03 2021 at 19:11)</a>:</h4>
<p>So I guess I'm writing myself a mini github client <span aria-label="grinning face with smiling eyes" class="emoji emoji-1f601" role="img" title="grinning face with smiling eyes">:grinning_face_with_smiling_eyes:</span></p>



<a name="244819960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819960">(Jul 03 2021 at 19:12)</a>:</h4>
<p><span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> if you want an example I wrote one for rustc-dev-guide</p>



<a name="244819965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819965">(Jul 03 2021 at 19:12)</a>:</h4>
<p><a href="https://github.com/rust-lang/rustc-dev-guide/blob/master/ci/check-in.sh">https://github.com/rust-lang/rustc-dev-guide/blob/master/ci/check-in.sh</a></p>



<a name="244819969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Yu [they/she] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819969">(Jul 03 2021 at 19:12)</a>:</h4>
<p>i <em>think</em> <code>/refs/pull/*/merge</code> only exists for PRs that are open and mergeable</p>



<a name="244819972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244819972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244819972">(Jul 03 2021 at 19:12)</a>:</h4>
<p><a href="https://github.com/rust-lang/rustc-dev-guide/blob/442ba10f1ee778ae60284f0244ad1217ef0ca202/ci/check-in.sh#L23">https://github.com/rust-lang/rustc-dev-guide/blob/442ba10f1ee778ae60284f0244ad1217ef0ca202/ci/check-in.sh#L23</a> in particular</p>



<a name="244820030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244820030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Doc Jones <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244820030">(Jul 03 2021 at 19:14)</a>:</h4>
<p><span class="user-mention silent" data-user-id="260325">Chris Denton</span> <a href="#narrow/stream/122651-general/topic/Search.20PRs.20for.20a.20file/near/244819921">said</a>:</p>
<blockquote>
<p>So I guess I'm writing myself a mini github client <span aria-label="grinning face with smiling eyes" class="emoji emoji-1f601" role="img" title="grinning face with smiling eyes">:grinning_face_with_smiling_eyes:</span></p>
</blockquote>
<p>Or you could use this.<br>
<a href="https://github.com/graphql-rust/graphql-client">https://github.com/graphql-rust/graphql-client</a></p>



<a name="244821771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244821771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244821771">(Jul 03 2021 at 20:00)</a>:</h4>
<p>If you just want to do a one-off query, I would just use <code>gh</code>.  Something like this:</p>
<div class="codehilite"><pre><span></span><code>gh pr list --limit 500 --json files,url  -q &#39;.[] | select(.files[].path==&quot;library/core/src/option.rs&quot;) | .url&#39;
</code></pre></div>



<a name="244822227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Search%20PRs%20for%20a%20file/near/244822227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Denton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Search.20PRs.20for.20a.20file.html#244822227">(Jul 03 2021 at 20:12)</a>:</h4>
<p>Thanks! That is quicker.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>